﻿using System;
using System.Linq;
using System.Windows.Forms;

namespace PassThePuzzle
{
    public partial class AnswerChecker : Form
    {
        private string[] members;

        public AnswerChecker(string[] categoryMembers)
        {
            InitializeComponent();
            members = categoryMembers;
        }

        private void buttonCheck_Click(object sender, EventArgs e)
        {
            if (textBoxCheck.Text.Length > 0)
            {
                textBoxAnswers.Text = string.Join("\r\n", Gameform.MatchLines(members, "^" + textBoxCheck.Text + "$").ToArray());
                textBoxAnswers.SelectAll();
            }
        }

        private void buttonClose_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
